from model.user_resume import UserResume
"""简历"""
class UserResumeDao(object):
    def __init__(self, session):
        self.session = session
    def add(self, resume):
        self.session.add(resume)

    def get_resume_by_user_id(self,user_id):
     try:
       resume = self.session.query(UserResume)\
           .filter(UserResume.user_id==user_id)
       if resume:
           return resume.first()
       else:
           return None
     except Exception as ex:
         raise ex


if __name__ == '__main__':
   # from utils.work_db import  Session
   # ss = Session()
   # dao = UserResumeDao(ss)
   # resume = dao.get_resume_by_user_id(user_id=39)
   # print(resume)
   # if not resume.mobile and not resume.tel:
   #     print("-----------ddd")
   pass